/**
 * 
 */
package ch.unisi.inf.gui;

import java.awt.Color;
import java.awt.*;
import javax.swing.*;




/**
 * @author bejarj@lu.unisi.ch
 *
 */
class FolderList extends JLabel implements ListCellRenderer {
    public FolderList() {
        setOpaque(true);
    }
    public Component getListCellRendererComponent(
        JList list,
        Object value,
        int index,
        boolean isSelected,
        boolean cellHasFocus)
    {
        setText(value.toString());
        setBackground(isSelected ? Color.red : Color.white);
        setForeground(isSelected ? Color.white : Color.black);
        return this;
    }
    
    
    public static void main(String[] args){
    	JFrame frame = new JFrame();
    	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	frame.setSize(new Dimension(300, 300));
    	
    	FolderList folder = new FolderList();
    	frame.setVisible(true);
    	
    }
}
